package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.NoteInfoDao;
import cn.topevery.garden.entity.dto.NoteInfoDTO;
import cn.topevery.garden.entity.po.NoteInfo;
import cn.topevery.garden.entity.po.NoteInfo;
import cn.topevery.garden.entity.query.NoteInfoQuery;
import cn.topevery.garden.entity.vo.NoteInfoVO;

import hw.topevery.framework.db.entity.DataPager;
import hw.topevery.framework.db.base.BaseEntityDao;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;

/**
 * 操作规范、应急预案、安全教育
 */
@Service
public class NoteInfoLogic extends BaseLogic<NoteInfo> {
    @Autowired
    NoteInfoDao noteInfoDao;

    @Override
    public BaseEntityDao<NoteInfo, Integer> getDao() {
        return noteInfoDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<NoteInfoVO> listPage(NoteInfoQuery query) {
        return noteInfoDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        noteInfoDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param noteInfo 实体
     */
    public void saveOrUpdate(String userId, NoteInfo noteInfo){
        noteInfoDao.saveOrUpdate(userId,noteInfo);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public NoteInfo getEntityByColumn(String key, String value) {
        return noteInfoDao.getEntityByColumn(key, value);
    }
}
